<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/css/plat-style.css" media="all">
    <style>
        thead tr th{text-align: center!important;}
        tr td{text-align: center!important;}
        .updateThis,.updatePassword,.showThis,.adjustThis {
            border: 1px solid #fff;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <form action="/recharge/cmoneyList" id="seachFrom" class="layui-form">
                	<input type="hidden" name="cid" value="${details.cid }"/>
                    <div class="layui-card-body">
                        <%-- 查询条件设置 --%>
                        <div class="layui-container" style="padding-bottom: 50px">
                            <div class="layui-col-md12">
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">明细时间：</div>
                                    <div class="layui-col-sm7">
                                        <input class="layui-input" name="queryTime" id="laydate-cn" autocomplete="off">
                                    </div>
                                </div>
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">会员账号：</div>
                                    <div class="layui-col-sm7">
                                        <input type="text" name="phone" class="layui-input" value="${details.phone}">
                                    </div>
                                </div>
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">流水号：</div>
                                    <div class="layui-col-sm7">
                                        <input type="text" name="payCode" class="layui-input" value="${details.payCode}">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12">&nbsp;</div>
                            <div class="layui-col-md12">
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">支付方式：</div>
                                    <div class="layui-col-sm7">
                                        <select name="payType">
                                            <option value="">请选择</option>
                                            <option value="1">支付宝</option>
                                            <option value="2">微信</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="layui-col-md4">
                                    <div class="layui-col-sm6">
                                        <button class="layui-btn layui-btn" type="submit">查询</button>
                                        <button class="layui-btn layui-btn-warm exportThis" data-type="exportThis" type="button">导出</button>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md12"><hr></div>
                        </div>
                        <%-- 数据展示 --%>
                        <table class="layui-table">
                            <thead>
                            <tr>
                                <th>会员账号</th>
                                <th>流水号</th>
                                <th>类型</th>
                                <th>支付方式</th>
                                <th>原始金额</th>
                                <th>操作金额</th>
                                <th>最后金额</th>
                                <th>创建时间</th>
                                <th>备注</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${pageInfo.records}" var="l">
                                <tr>
                                    <td>${l.phone}</td>
                                    <td>${l.payCode}</td>
                                    <td>${l.typeName}</td>
                                    <th>
                                        <c:if test="${l.payType == 1}">支付宝</c:if>
                                        <c:if test="${l.payType == 2}">微信</c:if>
                                    </th>
                                    <td>${l.original}</td>
                                    <td>${l.cost}</td>
                                    <td>${l.last}</td>
                                    <td><fmt:formatDate value="${l.createTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                    <td>${l.remark}</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                        <div class="test-table-reload-btn" style="margin-top: 10px;">
                            <%@include file="../paging.jsp" %>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','laydate'], function(){
        var $ = layui.$,layer = layui.layer,form = layui.form,
            element = layui.element,laydate=layui.laydate;
        form.render('select');
        element.render();
        laydate.render({
            elem: '#laydate-cn',
            range:'~'
        });

        var active = {
            exportThis:function (queryTime,payCode,phone) {
                window.location.href = encodeURI
                ("/export/handleExportCusMoneyDetail?queryTime="+queryTime+"&payCode="+payCode+"&phone="+phone+"&typeId=2");
            },
            handleThis:function (isout, msg, id){
            	layer.open({
                    title: msg,
                    type: 2,
                    area: ['550px', '520px'],
                    content: '/customer/changeMoney?isout='+isout+'&cid='+id
                });
            }
        };
        //导出
        $('.exportThis').on('click',function () {
            var exportThis = $(this).data('type');
            var queryTime = $('input[name="queryTime"]').val();
            var payCode = $('input[name="payCode"]').val();
            var phone = $('input[name="phone"]').val();
            active[exportThis] && active[exportThis].call(this,queryTime,payCode,phone);
        });
        
        $('.handleThis').on('click', function(){
        	var handleThis = $(this).data('type');
        	var isout = $(this).data('isout');
        	var msg = $(this).data('msg');
        	var id = $(this).data('id');
        	active[handleThis] && active[handleThis].call(this, isout, msg, id);
        });
    });
</script>
</body>
</html>